/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.bussines.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Vogel
 */
@Entity
@Table(name = "taller_prov_prod")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TallerProvProd.findAll", query = "SELECT t FROM TallerProvProd t"),
    @NamedQuery(name = "TallerProvProd.findByIdTallerProvProd", query = "SELECT t FROM TallerProvProd t WHERE t.idTallerProvProd = :idTallerProvProd")})
public class TallerProvProd implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Taller_Prov_Prod")
    private Integer idTallerProvProd;
    @JoinColumn(name = "id_Detalle_Orden", referencedColumnName = "id_Detalle_Orden")
    @ManyToOne(optional = false)
    private DetalleOrden idDetalleOrden;
    @JoinColumn(name = "Cod_Prod", referencedColumnName = "Cod_Prod")
    @ManyToOne(optional = false)
    private Productos codProd;

    public TallerProvProd() {
    }

    public TallerProvProd(Integer idTallerProvProd) {
        this.idTallerProvProd = idTallerProvProd;
    }

    public Integer getIdTallerProvProd() {
        return idTallerProvProd;
    }

    public void setIdTallerProvProd(Integer idTallerProvProd) {
        this.idTallerProvProd = idTallerProvProd;
    }

    public DetalleOrden getIdDetalleOrden() {
        return idDetalleOrden;
    }

    public void setIdDetalleOrden(DetalleOrden idDetalleOrden) {
        this.idDetalleOrden = idDetalleOrden;
    }

    public Productos getCodProd() {
        return codProd;
    }

    public void setCodProd(Productos codProd) {
        this.codProd = codProd;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTallerProvProd != null ? idTallerProvProd.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TallerProvProd)) {
            return false;
        }
        TallerProvProd other = (TallerProvProd) object;
        if ((this.idTallerProvProd == null && other.idTallerProvProd != null) || (this.idTallerProvProd != null && !this.idTallerProvProd.equals(other.idTallerProvProd))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.bussines.entities.TallerProvProd[ idTallerProvProd=" + idTallerProvProd + " ]";
    }
    
}
